package test.designmode.buttonlistener3;

/**
 * Created by shuoGG on 2018/8/10
 */
public class Button {
    // 代理
    private EventHandler eventHandler = new EventHandler();

    public void addHandler(Object obj, String method, Object ...arg) {
        eventHandler.addHandler(obj, method, arg);
    }

    public void click() throws Exception {
        System.out.println("按钮按下了");
        eventHandler.invokeAll();
    }
}
